﻿var status = 0;

var time = java.util.Calendar.getInstance();
var year = time.get(java.util.Calendar.YEAR); //获得年份
var month = time.get(java.util.Calendar.MONTH) + 1; //获得月份
var day = time.get(java.util.Calendar.DATE); //获取日
var hour = time.get(java.util.Calendar.HOUR_OF_DAY); //获得小时
var minute = time.get(java.util.Calendar.MINUTE); //获得分钟
var second = time.get(java.util.Calendar.SECOND); //获得秒
//var eff1 = "#fEffect/CharacterEff/1114000/1/0#"; //红星花
//var eff1 = "#fUI/StarCityUI.img/GradeInfo/icon_ss/7#"
var eff1 = "#fEffect/CharacterEff/1112949/3/0#"; //花样音符
//var eff1 = "#fUI/StarCityUI.img/GradeInfo/icon_ss/7#"
var z = "#fUI/UIWindow/Quest/icon5/1#"; //"+z+"//美化
var w = "#fEffect/CharacterEff/1051296/1/0#";
var p2 = "#fUI/SoulUI.img/DungeonMap/icon/dungeonItem/0#"
var tz12 = "#fEffect/CharacterEff/1112924/0/0#"; //黄星
var tz13 = "#fEffect/CharacterEff/1112925/0/0#"; //蓝星

function start() {
  status = -1;
  action(1, 0, 0);
}

function action(mode, type, selection) {
  if (status == 0 && mode == 0) {
    cm.dispose();
    return;
  }
  if (mode == 1) {
    status++;
  } else {
    status--;
  }
  if (cm.getMapId() == 180000001) {
    cm.sendOk("很遗憾，您因为违反用户守则被禁止游戏活动，如有异议请联系管理员.")
    cm.dispose();
  } else if (status == 0) {
    var selStr = "" + tz13 + "#d在线：#r" + cm.getPlayer().getTodayOnlineTime() + "#d 分钟 " + tz13 + "余额：#r" + cm.getHyPay(1) + "#d   " + tz13 + "#d积分为：#r" + cm.getPlayerPoints() + "#k点         " + tz13 + "#d点卷：#r" + cm.getPlayer().getCSPoints(1) + "#d        \t" + tz13 + "抵用券：#r" + cm.getPlayer().getCSPoints(2) + "#k\r\n #e#d当前时间" + hour + ":" + minute + ":" + second + "#k\r\n"
    selStr += "#L0#" + tz13 + "#d每日签到#l";
    selStr += "#L1#" + tz13 + "#d活跃查询#l";
    selStr += "#L7#" + tz13 + "#d新手神器#l\r\n";
    selStr += "#L2#" + tz13 + "#d登录奖励#l";
    selStr += "#L3#" + tz13 + "#d在线奖励#l";
    selStr += "#L6#" + tz13 + "#d等级奖励#l\r\n\r\n";
    selStr += "#L4#" + tz12 + "#r职业转职#l\r\n\r\n";
    // selStr += "#L5#" + tz12 +"#r一键五转#l\r\n\r\n";
    //selStr += "#L8#" + tz12 +"#r加入QQ群#l\r\n\r\n";



    cm.sendSimple(selStr);
  } else if (status == 1) {
    switch (selection) {
      case 0: //每日签到
        cm.dispose();
        cm.openNpc(0, "每日签到");
        break;
      case 1: //个活跃查询
        cm.dispose();
        cm.openNpc(0, "活跃查询");
        break;
      case 2: //登录奖励
        cm.dispose();
        cm.openNpc(0, "登录奖励");
        break;
      case 3: //在线奖励
        cm.dispose();
        cm.openNpc(0, "在线奖励");
        break;
      case 4: //转职系统
        cm.dispose();
        cm.openNpc(0, "转职系统");
        break;
      case 5: //一键五转
        cm.dispose();
        cm.openNpc(0, "一键五转");
        break;
      case 6:
        cm.dispose();
        cm.openNpc(0, "等级奖励");
        break;
      case 7:
        cm.sendOk("该功能关闭中");
        cm.dispose();
        // cm.openNpc(0, "新手神器");
        break;
      case 8:
        cm.dispose();
        cm.openWeb("https://jq.qq.com/?_wv=1027&k=58Sbgs7");
        cm.sendOk("#d已自动为您打开QQ群链接，请申请加入和小伙伴们一起玩耍吧");
        break;

    }
  }
}